import sevoes from "@/util/Http";
import Qs from "qs";
function advertisingInquire(data) {
  //查询
  return sevoes({
    method: "get",
    params: {
      _gp: "admin.advertisement",
      _mt: "queryAdvertisement",
      ...data,
    },
  });
}

function advertisingAddition(data) {
  //添加
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.advertisement",
      _mt: "addAdvertisement",
      ...data,
    }),
  })
}

function advertisingCompile(data) {
  //编辑
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.advertisement",
      _mt: "updateAdvertisement",
      ...data,
    }),
  })
}

function advertisingDelete(data) { 
  //删除
  return sevoes({
    method: "post",
    data: Qs.stringify({
      _gp: "admin.advertisement",
      _mt: "deleteAdvertisement",
      ...data,
    }),
  })
}

function getSpuBigTree() {
  //获取SPU树
  return sevoes({
    method: "get",
    params: {
      _gp: "admin.goods",
      _mt: "getSpuBigTree",
    },
  });
}

export default {
  advertisingInquire,
  advertisingAddition,
  advertisingCompile,
  advertisingDelete,
  getSpuBigTree
}